Stronger guarantees for standard-library containers

نویسنده

  • Jyrki Katajainen
چکیده

The Standard Template Library (STL) [13, 14] is a library of generic algorithms and data structures that has been incorporated in the C++ standard [1] and ships with all modern C++ compilers. In the CPH STL project [4] our goal is to implement an enhanced edition of the STL. Initially, our focus was on time and space efficiency of the STL components, but now we are also focusing on safety, reliability, and usability of the components. In my talk, I briefly discussed four types of guarantees our library should be able to provide for its users: time optimality, iterator validity, exception safety, and space efficiency. In the CPH STL, every container is a bridge class that calls the functions available in the actual realization given as a template argument. For example, the interface of a meldable priority queue looks as follows [11]:

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Towards stronger guarantees: Safer iterators

Iterators are a fundamental part of the STL. They are the link between generic algorithms and containers such that it is possible for the generic algorithms to traverse and access the elements in the container in a homogeneous way. The iterator validity property ensures that iterators are kept valid at any time except when the element is deleted. Modifications of the container should not affect...

متن کامل

Rationale for Adding Hash Tables to the C Standard Template Library

In Hash Tables for the Standard Template Library Barreiro Fraley and Musser propose a restructuring and extension of the STL requirements for associative containers to accommodate hash table implementations This paper gives the rationale for the proposed changes

متن کامل

Programming with the HPC++ Parallel Standard Template Library

We present an overview of the HPC++ Parallel Standard Template Library (PSTL), a parallel version of the C++ Standard Template Library (STL). The PSTL is part of HPC++, a C++ library and language extension framework being developed by the HPC++ consortium as a standard model for portable parallel programming in C++. The PSTL includes distributed versions of the seven STL containers (vector, lis...

متن کامل

Making operations on standard-library containers strongly exception safe∗

An operation on an element container is said to provide a strong guarantee of exception safety if, in case an exception is thrown, the operation leaves the container in the state in which it was before the operation. In this paper, we explore how to adjust operations on C++ standard-library containers to provide the strong guarantee of exception safety, instead of the default guarantee, without...

متن کامل

C + + Standard Template Library by Ranges *

The C++ Standard Template Library (STL) is the most popular library based on the generic programming paradigm. STL is widely-used, because the library is part of the C++ Standard. It consists of many useful generic data structures and generic algorithms, that are fairly irrespective of the used container. Iterators bridge the gap between containers and algorithms. As a result of this layout the...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007